package com.tonny.tweet.enumration;

public enum TweetStatusEnum {
    DELETED(0, "已删除"),
    NORMAL(1, "正常"),
    ;
    private Integer code;
    private String  value;
    
    public static TweetStatusEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        
        for (TweetStatusEnum statusEnum : values()) {
            if (statusEnum.getCode().equals(code)) {
                return statusEnum;
            }
        }
        
        return null;
    }
    
    TweetStatusEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public String getValue() {
        return value;
    }
}
